3.452 \(\int \frac{\tan ^2(c+d x)}{a+b \sin ^2(c+d x)} \, dx\)

Optimal. Leaf size=53 \[ \frac{\tan (c+d x)}{d (a+b)}-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (c+d x)}{\sqrt{a}}\right )}{d (a+b)^{3/2}} \]

[Out]

-((Sqrt[a]*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]])/((a + b)^(3/2)*d)) + Tan[c + d*x]/((a + b)*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0758715, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3195, 321, 205} \[ \frac{\tan (c+d x)}{d (a+b)}-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (c+d x)}{\sqrt{a}}\right )}{d (a+b)^{3/2}} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + b*Sin[c + d*x]^2),x]

[Out]

-((Sqrt[a]*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]])/((a + b)^(3/2)*d)) + Tan[c + d*x]/((a + b)*d)

Rule 3195

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[{ff
 = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[((d*ff*x)^m*(a + (a + b)*ff^2*x^2)^p)/(1 + ff^2*x^2)^(p
 + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m}, x] && IntegerQ[p]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\tan ^2(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{\tan (c+d x)}{(a+b) d}-\frac{a \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{(a+b) d}\\ &=-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (c+d x)}{\sqrt{a}}\right )}{(a+b)^{3/2} d}+\frac{\tan (c+d x)}{(a+b) d}\\ \end{align*}

Mathematica [A]  time = 0.129393, size = 53, normalized size = 1. \[ \frac{\tan (c+d x)}{d (a+b)}-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (c+d x)}{\sqrt{a}}\right )}{d (a+b)^{3/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + b*Sin[c + d*x]^2),x]

[Out]

-((Sqrt[a]*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]])/((a + b)^(3/2)*d)) + Tan[c + d*x]/((a + b)*d)

________________________________________________________________________________________

Maple [A]  time = 0.104, size = 53, normalized size = 1. \begin{align*}{\frac{\tan \left ( dx+c \right ) }{ \left ( a+b \right ) d}}-{\frac{a}{ \left ( a+b \right ) d}\arctan \left ({ \left ( a+b \right ) \tan \left ( dx+c \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+sin(d*x+c)^2*b),x)

[Out]

tan(d*x+c)/(a+b)/d-1/d/(a+b)*a/(a*(a+b))^(1/2)*arctan((a+b)*tan(d*x+c)/(a*(a+b))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.87778, size = 728, normalized size = 13.74 \begin{align*} \left [\frac{\sqrt{-\frac{a}{a + b}} \cos \left (d x + c\right ) \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \,{\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \,{\left ({\left (2 \, a^{2} + 3 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{3} -{\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt{-\frac{a}{a + b}} \sin \left (d x + c\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (d x + c\right )^{4} - 2 \,{\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) + 4 \, \sin \left (d x + c\right )}{4 \,{\left (a + b\right )} d \cos \left (d x + c\right )}, \frac{\sqrt{\frac{a}{a + b}} \arctan \left (\frac{{\left ({\left (2 \, a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt{\frac{a}{a + b}}}{2 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right ) + 2 \, \sin \left (d x + c\right )}{2 \,{\left (a + b\right )} d \cos \left (d x + c\right )}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

[1/4*(sqrt(-a/(a + b))*cos(d*x + c)*log(((8*a^2 + 8*a*b + b^2)*cos(d*x + c)^4 - 2*(4*a^2 + 5*a*b + b^2)*cos(d*
x + c)^2 + 4*((2*a^2 + 3*a*b + b^2)*cos(d*x + c)^3 - (a^2 + 2*a*b + b^2)*cos(d*x + c))*sqrt(-a/(a + b))*sin(d*
x + c) + a^2 + 2*a*b + b^2)/(b^2*cos(d*x + c)^4 - 2*(a*b + b^2)*cos(d*x + c)^2 + a^2 + 2*a*b + b^2)) + 4*sin(d
*x + c))/((a + b)*d*cos(d*x + c)), 1/2*(sqrt(a/(a + b))*arctan(1/2*((2*a + b)*cos(d*x + c)^2 - a - b)*sqrt(a/(
a + b))/(a*cos(d*x + c)*sin(d*x + c)))*cos(d*x + c) + 2*sin(d*x + c))/((a + b)*d*cos(d*x + c))]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan ^{2}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(tan(c + d*x)**2/(a + b*sin(c + d*x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.35371, size = 116, normalized size = 2.19 \begin{align*} -\frac{\frac{{\left (\pi \left \lfloor \frac{d x + c}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac{a \tan \left (d x + c\right ) + b \tan \left (d x + c\right )}{\sqrt{a^{2} + a b}}\right )\right )} a}{\sqrt{a^{2} + a b}{\left (a + b\right )}} - \frac{\tan \left (d x + c\right )}{a + b}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

-((pi*floor((d*x + c)/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(d*x + c) + b*tan(d*x + c))/sqrt(a^2 + a*b)))*a/
(sqrt(a^2 + a*b)*(a + b)) - tan(d*x + c)/(a + b))/d